package com.ccz.demo.validation;

import com.alibaba.fastjson.JSON;
import com.ccz.demo.util.ValidateUtil;

import java.util.*;

public class AnnotationTest {

    public static void main(String[] args) throws Exception {

        Map<String, Object> userMap = new HashMap<>();
//        userMap.put("name", null);
        userMap.put("date", new Date());
        userMap.put("childUser", Arrays.asList("1","2"));
        String tableName = "com.ccz.demo.validation.UserInfo";
        Class<?> aClass = Class.forName(tableName);
        Object o = JSON.parseObject(JSON.toJSONString(userMap), aClass);
        String s = ValidateUtil.doValidate(o);
        System.out.println(s);
        System.out.println(JSON.toJSONString(o));
    }

}
